//
//  ViewController.m
//  ShortcutManagerDemo
//
//  Created by 罗腾 on 2017/7/31.
//  Copyright © 2017年 gtexpress. All rights reserved.
//

#import "ViewController.h"
#import "OPShortcutConfigView.h"
@interface ViewController ()
@property(nonatomic,strong) OPShortcutConfigView * v;
@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    
    
    _v = [[OPShortcutConfigView alloc] initWithFrame:CGRectMake(0, 64, self.view.bounds.size.width, self.view.bounds.size.height-64)];
    
    NSArray *arrInuses = @[@{@"iconName":@"zhuanzhang",@"title":@"及时转账"},
                           @{@"iconName":@"shouji",@"title":@"手机充值"},
                           @{@"iconName":@"youka",@"title":@"油卡充值"},
                           @{@"iconName":@"dianziquan",@"title":@"电子券"},
                           @{@"iconName":@"kepiao",@"title":@"长途客票"},
                           @{@"iconName":@"qiangsheng",@"title":@"强生叫车"},
                           @{@"iconName":@"shangcheng",@"title":@"掌上商城"}
                           ];
    _v.inUseTitles = [NSMutableArray arrayWithArray:arrInuses];
    NSArray *arrUnuses = @[
                           @[@{@"iconName":@"zhuanzhang",@"title":@"及时转账"},
                             @{@"iconName":@"shouji",@"title":@"手机充值"},
                             @{@"iconName":@"youka",@"title":@"油卡充值"},
                             @{@"iconName":@"dianziquan",@"title":@"电子券"},
                             @{@"iconName":@"kepiao",@"title":@"长途客票"},
                             @{@"iconName":@"qiangsheng",@"title":@"强生叫车"}],
                           
                           
                           @[@{@"iconName":@"shangcheng",@"title":@"掌上商城"},
                             
                             @{@"iconName":@"game",@"title":@"游戏中心"},
                             @{@"iconName":@"jd",@"title":@"京东特卖"},
                             @{@"iconName":@"life",@"title":@"生活缴费"},
                             @{@"iconName":@"shanghu",@"title":@"商户通"}],
                           
                           ];
    _v.unUseTitles = [NSMutableArray arrayWithArray:arrUnuses];
    
    
    
    [self.view addSubview:_v];
    
    
    UIButton * btn1 = [[UIButton alloc]initWithFrame:CGRectMake(50, 10, 50, 30)];
    btn1.backgroundColor = [UIColor redColor];
    [btn1 addTarget:self action:@selector(btn1) forControlEvents:UIControlEventTouchUpInside];
    [btn1 setTitle:@"编辑" forState:UIControlStateNormal];
    [self.view addSubview:btn1];
    
    UIButton * btn2 = [[UIButton alloc]initWithFrame:CGRectMake(250, 10, 50, 30)];
    btn2.backgroundColor = [UIColor redColor];
    [btn2 addTarget:self action:@selector(btn2) forControlEvents:UIControlEventTouchUpInside];
    [btn2 setTitle:@"完成" forState:UIControlStateNormal];
    [self.view addSubview:btn2];
}

- (void)btn1
{
    [_v editBegin];
}

- (void)btn2
{
    [_v editEnd];
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
